home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SoundMaker 2003 (Professional Edition)
/
SoundMaker 2003 - Professional Edition.iso
/
midi tool
/
midioxse.exe
/
DATA.1
/
dataloop.rex
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-03-27
|
1KB
|
55 lines
/* REXX: Simple MIDI output loop */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
qName = MOXGetQueueName()
oldq = RxQueue( 'Set', qName )
/* MIDI-OX creates a semaphore with same name as queue */
sem = SysOpenEventSem( qName )
if sem = 0 then
running = 0
else
running = 1
do while running
do while Queued() <> 0
pull timestamp status data1 data2
if timestamp = 'END_DATA'
then do
running = 0
leave
end
/* leave on a high note */
if data1 = 96 & status = 144
then do
running = 0
leave
end
/* ... do any processing. Then ... */
if status = 144 then
status = 145
ret = MOXOutputMidi( status, data1, data2 )
if ret <> 0
then do
msg = "Error code: " || ret
call RxMessageBox msg, '', 'OK', 'STOP'
end
end
if running
then do
/* queue is empty: you could do other processing here */
ret = SysWaitEventSem( sem )
if ret <> 0 then
running = 0
end
end
call SysDropFuncs
exit